package com.yiduo.outpost.core.web.exception;

import org.springframework.context.MessageSource;

/**
 * @author yanwen
 */
public class SecurityExceptionTranslator implements ExceptionTranslator {
    @Override
    public boolean support(Throwable error) {
        return error instanceof org.springframework.security.core.AuthenticationException;
    }

    @Override
    public String translateException(Throwable error, MessageSource messageSource) {
        return error.getMessage();
    }
}
